home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / Libraries / SAT 2.3b4 / Misc / InterfacesUI.p < prev   
Text File  |  1995-01-22  |  9KB  |  307 lines

  1. unit InterfacesUI;
  2.  
  3. {Unit for making Think Pascal work with Universal Interfaces}
  4. {All units that are not in Interfaces.lib are not reflected here.}
  5. {This implements changes to the core Toolbox, excluding most System7-}
  6. {specific units. You have to inlude them in your project anyway, so}
  7. {you can just as well make the changes in the interface files as}
  8. {necessary.}
  9.  
  10. interface
  11.  
  12. {Controls}
  13.     type
  14.         ControlRef = ControlHandle;
  15.         ConstStr255Param = Str255;
  16.         WindowRef = WindowPtr;
  17.         ControlActionUPP = ProcPtr;
  18.     procedure SetControlTitle (theControl: ControlRef; title: ConstStr255Param);
  19.     inline
  20.         $A95F;
  21.     procedure GetControlTitle (theControl: ControlRef; var title: Str255);
  22.     inline
  23.         $A95E;
  24.     procedure UpdateControls (theWindow: WindowRef; updateRgn: RgnHandle);
  25.     inline
  26.         $A953;
  27.     procedure SetControlValue (theControl: ControlRef; theValue: INTEGER);
  28.     inline
  29.         $A963;
  30.     function GetControlValue (theControl: ControlRef): INTEGER;
  31.     inline
  32.         $A960;
  33.     procedure SetControlMinimum (theControl: ControlRef; minValue: INTEGER);
  34.     inline
  35.         $A964;
  36.     function GetControlMinimum (theControl: ControlRef): INTEGER;
  37.     inline
  38.         $A961;
  39.     procedure SetControlMaximum (theControl: ControlRef; maxValue: INTEGER);
  40.     inline
  41.         $A965;
  42.     function GetControlMaximum (theControl: ControlRef): INTEGER;
  43.     inline
  44.         $A962;
  45.     function GetAuxiliaryControlRecord (theControl: ControlRef; var acHndl: AuxCtlHandle): BOOLEAN;
  46.     inline
  47.         $AA44;
  48.     procedure SetControlReference (theControl: ControlRef; data: LONGINT);
  49.     inline
  50.         $A95B;
  51.     function GetControlReference (theControl: ControlRef): LONGINT;
  52.     inline
  53.         $A95A;
  54.     procedure SetControlAction (theControl: ControlRef; actionProc: ControlActionUPP);
  55.     inline
  56.         $A96B;
  57.     function GetControlAction (theControl: ControlRef): ControlActionUPP;
  58.     inline
  59.         $A96A;
  60.     procedure SetControlColor (theControl: ControlRef; newColorTable: CCTabHandle);
  61.     inline
  62.         $AA43;
  63.     function GetControlVariant (theControl: ControlRef): INTEGER;
  64.     inline
  65.         $A809;
  66.  {Dialogs}
  67.     type
  68.         DialogRef = DialogPtr;
  69.     procedure DisposeDialog (theDialog: DialogRef);
  70.     inline
  71.         $A983;
  72.     procedure UpdateDialog (theDialog: DialogRef; updateRgn: RgnHandle);
  73.     inline
  74.         $A978;
  75.     procedure GetDialogItem (theDialog: DialogRef; itemNo: INTEGER; var itemType: INTEGER; var item: Handle; var box: Rect);
  76.     inline
  77.         $A98D;
  78.     procedure SetDialogItem (theDialog: DialogRef; itemNo: INTEGER; itemType: INTEGER; item: Handle; {CONST}
  79.                                     var box: Rect);
  80.     inline
  81.         $A98E;
  82.     procedure HideDialogItem (theDialog: DialogRef; itemNo: INTEGER);
  83.     inline
  84.         $A827;
  85.     procedure ShowDialogItem (theDialog: DialogRef; itemNo: INTEGER);
  86.     inline
  87.         $A828;
  88.     procedure SelectDialogItemText (theDialog: DialogRef; itemNo: INTEGER; strtSel: INTEGER; endSel: INTEGER);
  89.     inline
  90.         $A97E;
  91.     procedure GetDialogItemText (item: Handle; var text: Str255);
  92.     inline
  93.         $A990;
  94.     procedure SetDialogItemText (item: Handle; text: ConstStr255Param);
  95.     inline
  96.         $A98F;
  97.     function FindDialogItem (theDialog: DialogRef; thePt: Point): INTEGER;
  98.     inline
  99.         $A984;
  100.     function NewColorDialog (dStorage: univ Ptr; {CONST}
  101.                                     var boundsRect: Rect; title: ConstStr255Param; visible: BOOLEAN; procID: INTEGER; behind: WindowRef; goAwayFlag: BOOLEAN; refCon: LONGINT; items: Handle): DialogRef;
  102.     inline
  103.         $AA4B;
  104.     function GetAlertStage: INTEGER;
  105.     inline
  106.         $3EB8, $0A9A;            { MOVE.W $0A9A,(SP) }
  107.  
  108.     procedure ResetAlertStage;
  109.     inline
  110.         $4278, $0A9A;
  111.     procedure DialogCut (theDialog: DialogRef);
  112.     procedure DialogPaste (theDialog: DialogRef);
  113.     procedure DialogCopy (theDialog: DialogRef);
  114.     procedure DialogDelete (theDialog: DialogRef);
  115.     procedure SetDialogFont (value: INTEGER);
  116.     inline
  117.         $31DF, $0AFA;            { MOVE.W (SP)+,$0AFA }
  118.  
  119. {Events}
  120.     function KeyTranslate (transData: univ Ptr; keycode: INTEGER; var state: LONGINT): LONGINT;
  121.     inline
  122.         $A9C3;
  123.  
  124. {Lists}
  125.     procedure LSetDrawingMode (drawIt: BOOLEAN; lHandle: ListHandle);
  126.     inline
  127.         $3F3C, $002C, $A9E7;
  128.     procedure LGetCellDataLocation (var offset: INTEGER; var len: INTEGER; theCell: Cell; lHandle: ListHandle);
  129.     inline
  130.         $3F3C, $0034, $A9E7;
  131.  
  132. {Memory}
  133.     function ApplicationZone: THz;
  134.     inline
  135.         $2EB8, $02AA;            { MOVE.L $02AA,(SP) }
  136.     function TempNewHandle (logicalSize: Size; var resultCode: OSErr): Handle;
  137.     inline
  138.         $3F3C, $001D, $A88F;
  139.     function TempMaxMem (var grow: Size): Size;
  140.     inline
  141.         $3F3C, $0015, $A88F;
  142.     function TempFreeMem: LONGINT;
  143.     inline
  144.         $3F3C, $0018, $A88F;
  145.  {  Temporary Memory routines renamed, but obsolete, in System 7.0 and later.  }
  146.     procedure TempHLock (h: Handle; var resultCode: OSErr);
  147.     inline
  148.         $3F3C, $001E, $A88F;
  149.     procedure TempHUnlock (h: Handle; var resultCode: OSErr);
  150.     inline
  151.         $3F3C, $001F, $A88F;
  152.     procedure TempDisposeHandle (h: Handle; var resultCode: OSErr);
  153.     inline
  154.         $3F3C, $0020, $A88F;
  155.     function TempTopMem: Ptr;
  156.     inline
  157.         $3F3C, $0016, $A88F;
  158.     procedure ReserveMem (cbNeeded: Size);
  159.     inline
  160.         $201F, $A040;
  161.     procedure ReserveMemSys (cbNeeded: Size);
  162.     inline
  163.         $201F, $A440;
  164.     procedure DisposePtr (p: Ptr);        {Unnecessary?}
  165.     inline
  166.         $205F, $A01F;
  167.     procedure DisposeHandle (h: Handle);    {Unnecessary?}
  168.     inline
  169.         $205F, $A023;
  170.     procedure ReallocateHandle (h: Handle; byteCount: Size);
  171.     inline
  172.         $201F, $205F, $A027;
  173.  {Menus}
  174.     type
  175.         MenuRef = MenuHandle;
  176.     procedure AppendResMenu (theMenu: MenuRef; theType: ResType);
  177.     inline
  178.         $A94D;
  179.     procedure InsertMenuItem (theMenu: MenuRef; itemString: ConstStr255Param; afterItem: INTEGER);
  180.     inline
  181.         $A826;
  182.     procedure DeleteMenuItem (theMenu: MenuRef; item: INTEGER);
  183.     inline
  184.         $A952;
  185.     procedure SetMenuItemText (theMenu: MenuRef; item: INTEGER; itemString: ConstStr255Param);
  186.     inline
  187.         $A947;
  188.     procedure GetMenuItemText (theMenu: MenuRef; item: INTEGER; var itemString: Str255);
  189.     inline
  190.         $A946;
  191.     function GetMenuHandle (menuID: INTEGER): MenuRef;
  192.     inline
  193.         $A949;
  194.     procedure DeleteMCEntries (menuID: INTEGER; menuItem: INTEGER);
  195.     inline
  196.         $AA60;
  197.     procedure DisposeMCInfo (menuCTbl: MCTableHandle);
  198.     inline
  199.         $AA63;
  200.  {OSUtils}
  201.     type
  202.         LongDateRec = DateTimeRec;
  203.         LongDateTime = Longint;
  204.     procedure LongDateToSeconds ({CONST}
  205.                                     var lDate: LongDateRec; var lSecs: LongDateTime);
  206.     inline
  207.         $2F3C, $8008, $FFF2, $A8B5;
  208.     procedure LongSecondsToDate (var lSecs: LongDateTime; var lDate: LongDateRec);
  209.     inline
  210.         $2F3C, $8008, $FFF0, $A8B5;
  211.     function IsMetric: BOOLEAN;
  212.     inline
  213.         $3F3C, $0004, $A9ED;
  214.     procedure DateToSeconds ({CONST}
  215.                                     var d: DateTimeRec; var secs: LONGINT);
  216.     procedure SecondsToDate (secs: LONGINT; var d: DateTimeRec);
  217.     inline
  218.         $205F, $201F, $A9C6;
  219. {PictUtils - unnecessary?}
  220. {function DisposePictInfo (thePictInfoID: PictInfoID): OSErr;}
  221. {inline}
  222. {$303C, $0206, $A831;}
  223.  {QuickDraw - unnecessary?}
  224.     procedure DisposePixMap (pm: PixMapHandle);
  225.     inline
  226.         $AA04;
  227.     procedure DisposePixPat (pp: PixPatHandle);
  228.     inline
  229.         $AA08;
  230.     procedure DisposeCTable (cTable: CTabHandle);
  231.     inline
  232.         $AA24;
  233.     procedure DisposeCCursor (cCrsr: CCrsrHandle);
  234.     inline
  235.         $AA26;
  236.     procedure DisposeCIcon (theIcon: CIconHandle);    {Rather Icons.p today?}
  237.     inline
  238.         $AA25;
  239.     procedure DisposeGDevice (gdh: GDHandle);
  240.     inline
  241.         $AA30;
  242.  {QuickdrawText}
  243. {function PixelToChar (textBuf: Ptr; textLength: LONGINT; slop: Fixed; pixelWidth: Fixed; var leadingEdge: BOOLEAN; var widthRemaining: Fixed; styleRunPosition: JustStyleCode; numer: Point; denom: Point): INTEGER;}
  244. {inline}
  245. {$2F3C, $8222, $002E, $A8B5;}
  246. {function CharToPixel (textBuf: Ptr; textLength: LONGINT; slop: Fixed; offset: LONGINT; direction: INTEGER; styleRunPosition: JustStyleCode; numer: Point; denom: Point): INTEGER;}
  247. {inline}
  248. {$2F3C, $821C, $0030, $A8B5;}
  249. {procedure DrawJustified (textPtr: Ptr; textLength: LONGINT; slop: Fixed; styleRunPosition: JustStyleCode; numer: Point; denom: Point);}
  250. {inline}
  251. {$2F3C, $8016, $0032, $A8B5;}
  252. {procedure MeasureJustified (textPtr: Ptr; textLength: LONGINT; slop: Fixed; charLocs: Ptr; styleRunPosition: JustStyleCode; numer: Point; denom: Point);}
  253. {inline}
  254. {$2F3C, $801A, $0034, $A8B5;}
  255. {function PortionLine (textPtr: Ptr; textLen: LONGINT; styleRunPosition: JustStyleCode; numer: Point; denom: Point): Fixed;}
  256. {inline}
  257. {$2F3C, $8412, $0036, $A8B5;}
  258.  {Resources}
  259.     function GetResourceSizeOnDisk (theResource: Handle): LONGINT;
  260.     inline
  261.         $A9A5;
  262.     function GetMaxResourceSize (theResource: Handle): LONGINT;
  263.     inline
  264.         $A821;
  265.     procedure RemoveResource (theResource: Handle);
  266.     inline
  267.         $A9AD;
  268.  {TextEdit}
  269.     type
  270.         TEClickLoopUPP = ProcPtr;
  271.         WordBreakUPP = ProcPtr;
  272.     procedure TESetAlignment (just: INTEGER; hTE: TEHandle);
  273.     inline
  274.         $A9DF;
  275.     procedure TETextBox (text: univ Ptr; length: LONGINT; {CONST}
  276.                                     var box: Rect; just: INTEGER);
  277.     inline
  278.         $A9CE;
  279.     function TEStyleNew ({CONST}
  280.                                     var destRect: Rect; {CONST}
  281.                                     var viewRect: Rect): TEHandle;
  282.     inline
  283.         $A83E;
  284.     procedure TESetStyleHandle (theHandle: TEStyleHandle; hTE: TEHandle);
  285.     inline
  286.         $3F3C, $0005, $A83D;
  287.     function TEGetStyleHandle (hTE: TEHandle): TEStyleHandle;
  288.     inline
  289.         $3F3C, $0004, $A83D;
  290.     procedure TEStylePaste (hTE: TEHandle);
  291.     inline
  292.         $3F3C, $0000, $A83D;
  293.     function TEGetStyleScrapHandle (hTE: TEHandle): StScrpHandle;
  294.     inline
  295.         $3F3C, $0006, $A83D;
  296.     procedure TEUseStyleScrap (rangeStart: LONGINT; rangeEnd: LONGINT; newStyles: StScrpHandle; fRedraw: BOOLEAN; hTE: TEHandle);
  297.     inline
  298.         $3F3C, $000B, $A83D;
  299.     procedure TESetClickLoop (clikProc: TEClickLoopUPP; hTE: TEHandle);
  300.     function TEGetScrapLength: LONGINT;
  301.     procedure TESetWordBreak (wBrkProc: WordBreakUPP; hTE: TEHandle);
  302.     procedure TEStyleInsert (text: univ Ptr; length: LONGINT; hST: StScrpHandle; hTE: TEHandle);
  303.     inline
  304.         $3F3C, $0007, $A83D;
  305.  
  306. implementation
  307. end.